/**
 *	 defined the main entry program
 *   VisualGroup JavaScript prototype Classes, version draf
 *  (c) 2008 Bill Vison <vison_ruan@126.com>
 *
 *
/*--------------------------------------------------------------------------*/
Ext.Loader.setConfig({
	enabled: true,
	paths : {
		'Ext.ux' :'./js/ux'
	}			
});
Ext.require([
    'Ext.ux.LoginDialog',
    'Ext.ux.form.IconCombo'
]);

/** ===============================
 * init ui interface 
 * ================================
 */
function init() {


	Ext.tip.QuickTipManager.init();
    var loginDialog = Ext.create('Ext.ux.LoginDialog', {
    	forgotPasswordLink: '<a href="http://support.microsoft.com/kb/189126" target="_blank">忘记密码?</a>',
        formPanel: {
        	url: 'mockdata/loginok.json'
        },
		listeners:{
			success: function (me,form,action) {
				var res = action.result.data;
				try {
					// --- after login ,load the main page or invoke the url ---
					var mainMethod = res.method;
					var uri = res.uri;
					// --- get to page ---
					// --- get menu ---
					window.location = uri;
				} catch (e) {
					alert("mainpage url : " + e);
				}					
			},
			failure: function (me,form,action) {
				var msg = action.result.msg;
				// --- show message ---				
				
				
			}
		}
	
    });
	loginDialog.show();


}

Ext.onReady(init);
// --- run the init method


